/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.addressBook.bean;

/**
 *
 * @author Administrator
 */
public class Groups implements Comparable<Groups> {

    private String groupName = null;
    private int count = 0;

    public Groups() {
    }

    public Groups(String groupName, int count) {
        this.groupName = groupName;
        this.count = count;
    }

    /**
     * @return the groupName
     */
    public String getGroupName() {
        return groupName;
    }

    /**
     * @param groupName the groupName to set
     */
    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    /**
     * @return the count
     */
    public int getCount() {
        return count;
    }

    /**
     * @param count the count to set
     */
    public void setCount(int count) {
        this.count = count;
    }

    @Override
    public int compareTo(Groups o) {
        if (this.groupName.compareTo(o.getGroupName()) > 0) {
            return 1;
        }
        if (this.groupName.compareTo(o.getGroupName()) < 0) {
            return -1;
        }
        return 0;
    }
}
